.ngm-formly-accordion,
.ngm-formly-expansion,
.metad-formly-expansion {
  .mat-expansion-panel-header-title {
    @apply text-base;
  }
  .mat-expansion-panel-header-description {
    flex-grow: 1;
  }
}

.pac-formly-chart-type {
  mat-select-trigger {
    .mat-icon-no-color {
      @apply text-gray-500;
      svg {
        g,
        path {
          fill: currentColor;
        }
      }
    }
  }
}

.pac-formly-chart-type__prefix {
  .mat-icon-no-color {
    @apply text-gray-600;
    svg {
      g,
      path {
        fill: currentColor;
      }
    }
  }
}

.cdk-overlay-pane {
  .ngm-formly-chart-type__panel {
    @apply mt-2;
  }

  &.mat-mdc-select-panel-above {
    .ngm-formly-chart-type__panel {
      @apply mb-2;
    }
  }
}

.ngm-dialog-container.pac-formly__table {
  .ant-table-wrapper {
    thead > tr > th {
      white-space: nowrap;
    }
  }
}

.ngm-formly-tab-group {
  .mat-tab-body-wrapper {
    flex: 1;
  }
}

/* 为 pac-formly-select 扩大一些 select panel 组件高度 */
.mat-select-panel-wrap {
  .mat-select-panel {
    max-height: 450px;
  }
}

.ngm-formly__row {
  @apply grid grid-cols-12 gap-x-4;
}
.ngm-formly__col-12 {
  @apply col-span-12 max-w-full;
}
.ngm-formly__col-9 {
  @apply col-span-9 max-w-full;
}
.ngm-formly__col-8 {
  @apply col-span-8 max-w-full;
}
.ngm-formly__col-6 {
  @apply col-span-6 max-w-full;
}
.ngm-formly__col-4 {
  @apply col-span-4 max-w-full;
}
.ngm-formly__col-3 {
  @apply col-span-3 max-w-full;
}
.ngm-formly__col-2 {
  @apply col-span-2 max-w-full;
}
.ngm-formly__col-1 {
  @apply col-span-1 max-w-full;
}
.ngm-formly__col_none {
  grid-column: none;
}

.ngm-formly__gap-2 {
  @apply gap-2;
}
.ngm-formly__my-2 {
  @apply my-2;
}

.pac-formly-mat-toggle {
  display: flex;
  .mat-slide-toggle {
    flex: 1;
  }
  .mat-slide-toggle-label-before .mat-slide-toggle-label {
    justify-content: space-between;
  }
}

.ngm-formly__virtual-scroll-viewport {
  .cdk-virtual-scroll-content-wrapper {
    max-width: 100%;
  }
}

.ngm-formly__select-option {
  .mat-option-text {
    display: inline-flex;
    align-items: center;
    .ngm-display-behaviour {
      display: inline-flex;
      flex: 1;
      max-width: 100%;
    }
  }

  &.ngm-formly__with-icon {
    .ngm-display-behaviour {
      max-width: calc(100% - 24px - 16px);
    }
  }
}

/* 默认 field group 纵向排列 */
formly-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: 100%;
  }

  .mat-mdc-menu-panel.ngm-formly {
    .mat-menu-item {
      .mat-radio-button {
        max-width: 100%;
        width: 100%;
        .mat-radio-label-content {
          flex: 1;
          overflow: hidden;
        }
      }
      .mat-checkbox {
        .mat-checkbox-layout {
          width: 100%;
        }
        .mat-checkbox-label {
          flex: 1;
        }
      }
    }
  }